package com.zhangxun.mapper;

import com.zhangxun.domain.SysMenu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 张循
* @description 针对表【sys_menu(菜单管理)】的数据库操作Mapper
* @createDate 2022-12-29 15:29:14
* @Entity com.zhangxun.domain.SysMenu
*/
public interface SysMenuMapper extends BaseMapper<SysMenu> {

    @Select("select t1.* from sys_menu t1 \n" +
            "            left join sys_role_menu  t2 on t1.menu_id = t2.menu_id\n" +
            "            left join sys_user_role t3 on t3.role_id = t2.role_id\n" +
            "            where t3.user_id = #{userId} and t1.type != 2")
    List<SysMenu> selectMenuByUserId(Long userId);
}




